import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

export default new VueRouter({
    // linkActiveClass: 'head-menu-link-active',
    mode: 'history',
    routes: [
        { path: '*', redirect: '/' },
        {
            path: '/',
            name: 'Index',

            component: resolve => require(['../pages/index/index.vue'], resolve),
        },
        {
            path: '/enterprise',
            component: resolve => require(['../pages/enterprise/index.vue'], resolve),
        },
        {
            path: '/enterprise/detail/:id',
            component: resolve => require(['../pages/enterprise/detail.vue'], resolve),
        },
        { path: '/dw', component: resolve => require(['../pages/dw/index.vue'], resolve) },
        {
            path: '/brand',
            component: resolve => require(['../pages/brand/index.vue'], resolve),
        },
        {
            path: '/brand/detail',
            component: resolve => require(['../pages/brand/detail.vue'], resolve),
        },
        {
            path: '/about',
            component: resolve => require(['../pages/about/index.vue'], resolve),
        },
        {
            path: '/product',
            component: resolve => require(['../pages/product/index.vue'], resolve),
        },
        {
            path: '/goodsHot',
            component: resolve => require(['../pages/hot/goodsHot.vue'], resolve),
        },
        {
            path: '/dynamic',
            component: resolve => require(['../pages/dynamic/dynamic.vue'], resolve),
        },
        {
            path: '/dynamic/detail',
            component: resolve => require(['../pages/dynamic/detail.vue'], resolve),
        },
        {
            path: '/technology',
            component: resolve => require(['../pages/technology/technology.vue'], resolve),
        },
        {
            path: '/index/product/detail/:id',
            component: resolve => require(['../pages/product/detail.vue'], resolve),
        },
        {
            path: '/headers',
            component: resolve => require(['../components/head.vue'], resolve),
        },
    ],
    // scrollBehavior(to, from, savedPosition) {
    //     if (savedPosition) {
    //         return savedPosition;
    //     }
    //     return { x: 0, y: 0 };
    // },
});
